﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Bddify.Reporters;

namespace Bddify.Tests.Reporters
{
    public class TestableHtmlReportBuilder : HtmlReportBuilder
    {
        public string Html { get { return _html.ToString(); } }
        public int TabCount { get { return _tabCount; } set { _tabCount = value; } }

        TestableHtmlReportBuilder(HtmlReportViewModel viewModel)
            : base(viewModel)
        {
        }

        public static TestableHtmlReportBuilder Create()
        {
            return Create(new List<Core.Story>());
        }

        public static TestableHtmlReportBuilder Create(IEnumerable<Core.Story> stories)
        {
            var config = new DefaultHtmlReportConfigurationModule();
            var viewModel = new HtmlReportViewModel(config, stories);

            return new TestableHtmlReportBuilder(viewModel);
        }

        public HtmlReportTag OpenTag(string openingTag, HtmlTag tag)
        {
            return base.OpenTag(openingTag, tag);
        }

        public HtmlReportTag OpenTag(HtmlTag tag)
        {
            return base.OpenTag(tag);
        }

        public void CloseTag(HtmlTag tag)
        {
            base.CloseTag(tag);
        }

        public void AddLine(string line)
        {
            base.AddLine(line);
        }
    }
}
